﻿using UnityEngine;
using System.Collections;
namespace LinCode
{
    public static class LoadAssetHelper
    {
        public static GameObject ResourcesLoadPlayerTankFireGameObjectByName(string objectName)
        {


            GameObject g = Resources.Load("PlayerTankFire/" + objectName, typeof(GameObject)) as GameObject;
            if (g == null)
            {
                Debug.Log("PlayerTankFire isnull");
                return null;

            }
            else
            {
                return g;
            }


        }

        public static GameObject ResourcesLoadEnemyFireGameObjectByName(string objectName)
        {


            GameObject g = Resources.Load("EnemyFire/" + objectName, typeof(GameObject)) as GameObject;
            if (g == null)
            {
                Debug.Log("EnemyFire isnull");
                return null;

            }
            else
            {
                return g;
            }


        }


        public static Sprite ResourcesLoadSpriteByName(string spriteName)
        {


            Sprite s = Resources.Load("Person_TankImage/" + spriteName, typeof(Sprite)) as Sprite;
            if (s == null)
            {
                Debug.Log("sprite isnull");
                return null;

            }
            else
            {
                Debug.Log("sprite 不为空");
                return s;
            }


        }

    }
}
